<div id="tiga_ba">
	<div id="tiga_baa">Data Tarif INACBG </div>
	<?php
	if(!empty($_GET['nama'])){
		$param_nama=$_GET['nama'];
	}else{
		$param_nama=$_POST['nama'];
	}
	$id_kelas_tarif=$_GET['id_kelas_tarif'];
?>
	<div id="tiga_bab">
		<a href="javascript:void(0)" onClick="location.href='utama.php?module=mod_tarif_inacbg&id_kelas_tarif=<?php echo $id_kelas_tarif;?>&view=form_tambah'">
			<button class="button">Tambah</button>
		</a>
	</div>
	<div class="clear"></div>
</div>


<table style="margin-left: 5px;" width="830">
	<tr>
		<form method=post action='utama.php?module=mod_tarif_inacbg&id_kelas_tarif=<?php echo $id_kelas_tarif;?>'>
		<td width="65">Pencarian  : </td>
		<td width="200"><input type="text" name="nama" value="<?php echo $param_nama; ?>" class="input_field" /></td>
		<td></td>
		<td><input name="submit" type="submit" class="button" value="Cari" /></td>
		<td></td>
		</form>
		<form method="post" enctype="multipart/form-data" action="module/mod_tarif_inacbg/proses.php?kls=<?php echo $id_kelas_tarif; ?>">
		<td>Import CSV :</td>
		<td><input name="userfile" type="file"></td>
		<td><input name="upload" type="submit" class="button" value="Import"></td>
		</form>
		<td align="right"><a href="utama.php?module=mod_tarif_inacbg&view=form_cetak&id=<?php echo $id_kelas_tarif;?>"><img src="asset/images/print.png" width="30"></a></td>
	</tr>
</table>


<table class="tabel">
	<tr>
		<th>NO</th>
		<th>Aksi</th>
		<th>Kode</th>
		<th>Deskripsi</th>
		<th>Jenis</th>
		<th>Tarif</th>
	</tr>
	<?php
		$p= new paging ;
		$batas= 10;

		//cek halaman dan posisi halaman
		$posisi = $p ->cariposisi($batas) ;
		$sql="SELECT a.kode_inacbg,b.id_tarif_inacbg,a.kode_inacbg as id,a.deskripsi,b.tarif_inacbg, j.jenis_inacbg  FROM master_inacbg a inner JOIN tarif_inacbg b ON a.kode_inacbg=b.kode_inacbg inner join jenis_inacbg j on j.id_jenis_inacbg = a.id_jenis_inacbg where a.deskripsi like '%$param_nama%' and id_kelas_tarif='$id_kelas_tarif' order by a.kode_inacbg asc limit $posisi,$batas";
		//echo $sql;
		$qry=mysql_query($sql);
		$no=$posisi + 1;
		if(mysql_num_rows($qry)>0){
		
			while($hasil=mysql_fetch_array($qry)){
	?>
				<tr>
					<td align="center" width="30"><?php echo $no;?></td>
					<td align="center" align="center" width="60">
						<a href="utama.php?module=mod_tarif_inacbg&id_kelas_tarif=<?php echo $_GET['id_kelas_tarif'];?>&view=form_edit&id=<?php echo $hasil['id_tarif_inacbg'];?>">
						<img src="asset/images/edit.png" title="Ubah Data"></a> 
						<a href="utama.php?module=mod_tarif_inacbg&id_kelas_tarif=<?php echo $_GET['id_kelas_tarif'];?>&act=hapus&id=<?php echo $hasil['id_tarif_inacbg'];?>" onclick="return confirm('Anda yakin ingin Menghapus Data ?')"><img src="asset/images/delete.png" title="Hapus Data"></a>
					</td>
					<td ><?php echo $hasil['kode_inacbg'];?></td>
					<td ><?php echo $hasil['deskripsi'];?></td>
					<td ><?php echo $hasil['jenis_inacbg'];?></td>
					<td align="right" width="60"><?php echo desimal($hasil['tarif_inacbg']);?></td>
				</tr>
				
		<?php
				$no++;
			}
		}else{
		?>
	
	<tr>
		<td colspan="7" align="center">Data tidak Ada </td>
	</tr>
	
	<?php
		}
	?>
</table>

<?php
	$sql2="SELECT b.id_tarif_inacbg,a.kode_inacbg as id,a.deskripsi ,b.tarif_inacbg  FROM master_inacbg a LEFT JOIN tarif_inacbg b ON a.kode_inacbg=b.kode_inacbg where deskripsi like '%$param_nama%' and id_kelas_tarif='$id_kelas_tarif'" ;
	$query2=mysql_query($sql2);
	$jumlah_data=mysql_num_rows($query2);
	//dapatkan jumlah halaman
	$jumlah_halaman= $p->jumlahhalaman($jumlah_data,$batas);
	//cetak link
	$linkhalaman=$p->navhalaman($_GET['halaman'],$jumlah_halaman,$_SERVER['PHP_SELF']."?module=mod_tarif_inacbg&id_kelas_tarif=$id_kelas_tarif","nama=$param_nama");
	print($linkhalaman);
?>
        